<html>
<head><meta charset="utf-8"><title>cargo check --no-tests? · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html">cargo check --no-tests?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214650577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214650577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214650577">(Oct 27 2020 at 00:49)</a>:</h4>
<p>Is there something like <code>cargo check --all-targets</code> that checks everything <em>except</em> tests?</p>



<a name="214650625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214650625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214650625">(Oct 27 2020 at 00:50)</a>:</h4>
<p>use case: after <a href="https://github.com/rust-lang/rust/pull/77351">https://github.com/rust-lang/rust/pull/77351</a>, <code>x.py clippy --fix</code> will work for everything except <code>libtest</code>, which is broken</p>



<a name="214650664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214650664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214650664">(Oct 27 2020 at 00:51)</a>:</h4>
<p>actually I think I could hack this by unconditionally building <code>library/test</code> before running clippy <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="214650677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214650677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214650677">(Oct 27 2020 at 00:51)</a>:</h4>
<p>you have to list out the other targets, like <code>--lib --bins --examples</code></p>



<a name="214650819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214650819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214650819">(Oct 27 2020 at 00:53)</a>:</h4>
<p>would you be open to a PR adding <code>--no-tests</code>? It's hard to remember all the different targets - I think I'd need <code>--lib --bins --examples --benches</code>?</p>



<a name="214650831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214650831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214650831">(Oct 27 2020 at 00:53)</a>:</h4>
<p>also <code>x.py build library/test</code> did not help <span aria-label="cry" class="emoji emoji-1f622" role="img" title="cry">:cry:</span></p>



<a name="214651082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214651082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214651082">(Oct 27 2020 at 00:57)</a>:</h4>
<p>i'd be reluctant to add more flags, as it is already quite complex, unless there is a widespread desire for it</p>



<a name="214651139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214651139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214651139">(Oct 27 2020 at 00:58)</a>:</h4>
<p>fair enough</p>



<a name="214652831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214652831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214652831">(Oct 27 2020 at 01:30)</a>:</h4>
<p>Related: is there a way to say 'check libraries if they exist'?</p>



<a name="214652836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214652836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214652836">(Oct 27 2020 at 01:30)</a>:</h4>
<p>if you say <code>--lib</code>, cargo gives an error if there's only a binary:</p>
<div class="codehilite"><pre><span></span><code>    error: no library targets found in package `rustdoc-tool`
</code></pre></div>



<a name="214652913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214652913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214652913">(Oct 27 2020 at 01:32)</a>:</h4>
<p>FWIW, I think having <code>--no-X</code> is a reasonable pairing to existing ones.</p>



<a name="214652920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20check%20--no-tests%3F/near/214652920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20check.20--no-tests.3F.html#214652920">(Oct 27 2020 at 01:33)</a>:</h4>
<p>E.g. <code>--tests</code> <code>--no-tests</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>